#pragma once
typedef int Element_t;
typedef class {
public:
	Element_t *data;
	int *groupID;
	int n;
}QuickFindSet;

QuickFindSet* createQFSet(int n);
void releaseQFSet(QuickFindSet* set);

void initQFSet(QuickFindSet* set,Element_t data[],int n);

void unionQFSet(QuickFindSet* set, Element_t a, Element_t b);
int findQFSet(QuickFindSet* set,Element_t a ,Element_t b);